package com.jy.api.vo.pos.coupon;

import com.jy.api.domain.CouponType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by lihu on 2017/11/20.
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class CouponInstanceVo {

    private int totalPages;


    private long totalElements;


    private List<CouponInstance> couponInstances = new ArrayList<>();


    public CouponInstanceVo(int totalPages, long totalElements) {
        this.totalPages = totalPages;
        this.totalElements = totalElements;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class CouponInstance {

        private String id;

        /**
         * 优惠券类型
         */
        @Enumerated(EnumType.STRING)
        private CouponType type;

        private String storeId;

        /**
         * 优惠券实例编码
         */
        private String code;

        /**
         * 起用时间
         */
        private Date beginTime;
        /**
         * 结束时间
         */
        private Date endTime;


        /**
         * logo URL
         */
        private String logoURL;


        /**
         * 优惠券名称
         */
        private String title;
        /**
         * 使用说明
         */
        private String notice;
        /**
         * 优惠券详细说明
         */
        private String description;

        /**
         * 商品id，当CouponType=GET_ITEM_FREE时不为空
         */
        private String productId;
        /**
         * 商品名称，当CouponType=GET_ITEM_FREE时不为空
         */
        private String productName;
    }


}
